1 package uk.ac.roe.antigen.textcomponents; 2 3 import org.apache.tools.ant.input.DefaultInputHandler; 4 import org.apache.tools.ant.input.InputRequest; 5 6 /*** 7 * Prompts on System.err, reads input from System.in 8 * 9 * @version $Revision: 1.1 $ 10 */ 11 public class DefaultPromptingInputHandler extends DefaultInputHandler { 12 13 /*** 14 * Constructs user prompt from a request. 15 * Supplies default if present 16 * @param request the request to construct the prompt for. 17 * Must not be <code>null</code>. 18 * @return the prompt to ask the user 19 */ 20 protected String getPrompt(InputRequest request) { 21 StringBuffer prompt = new StringBuffer(super.getPrompt(request)); 22 23 String defaul = request.getDefault(); 24 if (defaul!=null) { 25 prompt.append("\nPress Ret to accept default:["+defaul+"]"); 26 } 27 return prompt.toString(); 28 } 29 30 31 }